package com.cd.university.db.mapper;

import com.cd.university.db.pojo.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface PermissionMapper {

    int deleteByPrimaryKey(Integer permissionId);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer permissionId);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    /**
     * 查询所有open为1的权限
     * @return 返回权限列表
     */
    public List<Permission> searchPermissionByOpen();

    /**
     * 查询角色对应的权限
     * @param roleId 角色id
     * @return 权限名称
     */
    public List<String> searchPreNameByRid(int roleId);
}
